﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Meqs.Entity;
using System.Collections.Generic;

public partial class School_Manage_InputScore_Top : System.Web.UI.Page
{
    /// <summary>
    /// 考试号
    /// </summary>
    protected int examid = 0;
    /// <summary>
    /// 是否为统考 -1错误，1是，0不是
    /// </summary>
    protected int eexam = -1;
    /// <summary>
    /// 显示的标题
    /// </summary>
    protected string title = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string iseexam = Request.QueryString["eexam"];
            string id = Request.QueryString["examid"];
            //string iseexam = "1";
            //string id = "1";
            int temp = 0;
            if (int.TryParse(id, out temp))
            {
                examid = temp;
            }

            temp = -1;
            if (int.TryParse(iseexam, out temp))
            {
                eexam = temp;
            }

            if (eexam != -1 && examid != 0)
            {
                title = GetTitle();

            }

        }
    }
    protected string GetTitle()
    {
        ///是统考
        if (eexam == 1)
        {
            ExamsEducation ee = Container<Meqs.Logic.Interface.IExamsEducationLogic>.Instance.FindById(examid);
            return CommonScore.ConvertYearAndTerm(ee.SchoolYear, ee.Term) + CommonScore.ConvertGradeNum(ee.Grade) + CommonScore.ConvertClassType(ee.ClassType) + "<br>" + ee.Name + " 成绩录入";
        }

        ///不是统考
        Hashtable ht = new Hashtable();
        ht.Add("SchoolMark", CommonScore.GetSchoolMark);
        ht.Add("RID", examid);
        IList<ExamsSchool> es = Container<Meqs.Logic.Interface.IExamsSchoolLogic>.Instance.FindAll(ht);
        if (es.Count > 0)
        {
            return CommonScore.ConvertYearAndTerm(es[0].SchoolYear, es[0].Term) + CommonScore.ConvertGradeNum(es[0].Grade) + CommonScore.ConvertClassType(es[0].ClassType) + "<br>" + es[0].Name + " 成绩录入";
        }
        return "";

    }
}
